package controller

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"web-tools-go/utils"
)

func Md5Page(c *gin.Context) {
	c.HTML(http.StatusOK, "md5.html", gin.H{})
}

func Md5Transform(c *gin.Context) {
	s := c.PostForm("text")
	v := utils.GenerateMd5(s)
	c.JSON(http.StatusOK, gin.H{
		"code": 1,
		"msg":  v,
	})
}
